Micron Document
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| SparkN0de-git | SparkN0de |
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Commit 6f1997076da13bdeb662ac543f25664a07946a3d


Parents : 1207aae
Author : Ivan <ivan@quad4.io>
Signature : Invalid signer <e46112d44649266d71fe2193e00a4710>, author is <ivan@quad4.io>
Date : 2026-07-06T08:35:53-05:00

fix(unify-backend): update error reporting for module set mismatches in library.zip across architectures

Changes

2 files changed, 21 insertions(+), 3 deletions(-)


Diff

diff --git a/scripts/ci/github-install-macos-x64-python-deps.sh b/scripts/ci/github-install-macos-x64-python-deps.sh
index b365c126..59eea3cb 100755
--- a/scripts/ci/github-install-macos-x64-python-deps.sh
+++ b/scripts/ci/github-install-macos-x64-python-deps.sh
@@ -128,6 +128,16 @@ uv pip install --python "$_PY" \
--python-platform x86_64-apple-darwin \
"$_pycodec2_wheel"
+# Cython/wheel are build-time-only tools for the pycodec2 sdist compile above;
+# the finished wheel's .so no longer needs them at runtime. uv.lock does not
+# pin either, so leaving them installed would make this venv's site-packages
+# diverge from .venv's (arm64, which never builds pycodec2 from source and
+# never needs them) -- cx_Freeze's module finder bundles whatever is actually
+# importable, so an extra build tool sitting in site-packages here can end up
+# in lib/library.zip on one slice only, which unify-backend then rejects as a
+# genuine module-set mismatch between the two macOS trees.
+uv pip uninstall --python "$_PY" Cython wheel
+
# pycodec2's setup.py links with -lcodec2, so the extension records Homebrew's
# absolute install name for libcodec2 (e.g. /usr/local/opt/codec2/lib/libcodec2.1.2.dylib).
# That only resolves on this CI runner. Bundle the dylib next to the extension and

diff --git a/scripts/unify-backend-plain-files.sh b/scripts/unify-backend-plain-files.sh
index a6c4703e..be858f48 100755
--- a/scripts/unify-backend-plain-files.sh
+++ b/scripts/unify-backend-plain-files.sh
@@ -92,12 +92,15 @@ while IFS= read -r -d '' rel; do
# same set of modules; a differing member list would mean the two
# Python environments actually resolved different dependencies.
if [[ "$(basename "$rel")" == "library.zip" ]]; then
- if diff -q \
- <(zipinfo -1 "$arm64_file" 2>/dev/null | sort) \
- <(zipinfo -1 "$x64_file" 2>/dev/null | sort) >/dev/null 2>&1; then
+ arm64_members="$(mktemp)"
+ x64_members="$(mktemp)"
+ zipinfo -1 "$arm64_file" 2>/dev/null | sort >"$arm64_members"
+ zipinfo -1 "$x64_file" 2>/dev/null | sort >"$x64_members"
+ if cmp -s "$arm64_members" "$x64_members"; then
cp "$arm64_file" "$x64_file"
echo " unified (library.zip, same bundled module set): $rel"
unified=$((unified + 1))
+ rm -f "$arm64_members" "$x64_members"
continue
fi
echo "unify-backend: ERROR: $rel bundles a different set of modules on arm64 vs x64" >&2
@@ -105,6 +108,11 @@ while IFS= read -r -d '' rel; do
echo " .venv and .venv-x64. Check that both install the same locked" >&2
echo " dependency set (uv.lock) via scripts/ci/github-install-deps.sh and" >&2
echo " scripts/ci/github-install-macos-x64-python-deps.sh." >&2
+ echo " Only present on arm64 (missing from x64):" >&2
+ comm -23 "$arm64_members" "$x64_members" | sed 's/^/ /' >&2
+ echo " Only present on x64 (missing from arm64):" >&2
+ comm -13 "$arm64_members" "$x64_members" | sed 's/^/ /' >&2
+ rm -f "$arm64_members" "$x64_members"
exit 1
fi
pkg_dir="$(dirname "$rel")"


──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────